﻿<!--
//===============================================================================
// Mammoth Patter Miner 2008
//===============================================================================
// Copyright (C) 2008 Arkadiusz Świerczek and Piotr Włodek. All rights reserved.
//===============================================================================
// Defines user interface for the MainView.
//===============================================================================
-->

<Controls1:ChromeWindow x:Class="WpfRcp.Views.Windows.Shell" x:Name="m_Window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="http://www.codeplex.com/CompositeWPF"
        xmlns:Globals1="clr-namespace:WpfRcp.Core.Globals;assembly=WpfRcp.Core"
        xmlns:Controls1="clr-namespace:WpfRcp.Controls;assembly=WpfRcp.Controls"
        xmlns:Windows1="clr-namespace:WpfRcp.Views.Windows" 
        xmlns:Controls2="clr-namespace:WpfRcp.Core.Views;assembly=WpfRcp.Core"
        Height="600" Width="800" MinHeight="400" MinWidth="700"
        ChromeWindowStyle="NoChrome" WindowStyle="SingleBorderWindow" ResizeMode="CanResize" BorderThickness="0"
        WindowStartupLocation="CenterScreen" Background="{DynamicResource MainWindowBackground}" Focusable="True"
        Style="{StaticResource DefaultChromeWindowStyleKey}" Margin="0" Icon="{Binding RcpSettings.WindowIcon}"
        Title="{Binding RcpSettings.TaskBarAppName}">

    <Window.Resources>
        <Storyboard x:Key="Intro">
            <DoubleAnimation Storyboard.TargetName="m_LeftToolBarPanel" Storyboard.TargetProperty="RenderTransform.X"
                             From="-200" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_HeaderPanel" Storyboard.TargetProperty="RenderTransform.Y"
                             From="-200" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_RightPanelTabControl" Storyboard.TargetProperty="RenderTransform.X"
                             From="550" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_StatusBar" Storyboard.TargetProperty="RenderTransform.Y"
                             From="100" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" />

            <DoubleAnimation Storyboard.TargetName="m_VisualizationTabControl" Storyboard.TargetProperty="Opacity"
                             From="0" To="1" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0.5" />
        </Storyboard>

        <Storyboard x:Key="HeaderGone">

            <ThicknessAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Margin"
                                To="0,-32,0,0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <DoubleAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Opacity"
                             From="1" To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ThicknessAnimation Storyboard.TargetName="m_MainPanel" Storyboard.TargetProperty="Margin"
                                To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0:0:1.5" Value="{x:Static Visibility.Collapsed}" />
            </ObjectAnimationUsingKeyFrames>

        </Storyboard>

        <Storyboard x:Key="HeaderAppeared">

            <ThicknessAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Margin"
                                    To="0" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <DoubleAnimation Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Opacity"
                                 From="0" To="1" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ThicknessAnimation Storyboard.TargetName="m_MainPanel" Storyboard.TargetProperty="Margin"
                                    To="20" Duration="0:0:1.5" AutoReverse="False" DecelerationRatio="0.5" BeginTime="0:0:0" />

            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="m_Header" Storyboard.TargetProperty="Visibility">
                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}" />
            </ObjectAnimationUsingKeyFrames>

        </Storyboard>
        
    </Window.Resources>

    <DockPanel x:Name="m_MainPanel" Margin="20">
        
        <DockPanel.LayoutTransform>
            <ScaleTransform CenterX="0"
                            CenterY="0"
                            ScaleX="{Binding Path=Settings.WorkspaceScale}"
                            ScaleY="{Binding Path=Settings.WorkspaceScale}" />
        </DockPanel.LayoutTransform>
        
        <!--HEADER AND MENU-->
        <StackPanel x:Name="m_HeaderPanel" DockPanel.Dock="Top">
            <StackPanel.RenderTransform>
                <TranslateTransform X="0" Y="0" />
            </StackPanel.RenderTransform>

            <!--HEADER-->
            <Grid x:Name="m_Header" Margin="0,0,0,0" Visibility="Visible">
                <Grid.RenderTransform>
                    <TranslateTransform X="0" Y="0" />
                </Grid.RenderTransform>

                <StackPanel Orientation="Horizontal">
                    <TextBlock FontFamily="Segoe" FontSize="36" FontStretch="Normal" FontWeight="Light"
                            TextWrapping="Wrap" Margin="-2,-15.14,0,0"
                            Foreground="{DynamicResource MammothHeader1Foreground}"
                            Text="{Binding RcpSettings.AppName}" />
                    <TextBlock FontFamily="Segoe" FontSize="36" FontStretch="Normal" FontWeight="Light"
                            TextWrapping="Wrap" Margin="5,-15.14,0,0"
                            Foreground="{DynamicResource MammothHeader2Foreground}"
                            Text="{Binding RcpSettings.AppNameExtended}" />
                </StackPanel>
            </Grid>

            <!--TOP MENU-->
            
        </StackPanel>

        <!--STATUS BAR-->
        <StatusBar Height="22" Margin="0,5,0,0" DockPanel.Dock="Bottom" Name="m_StatusBar">
            <StatusBar.RenderTransform>
                <TranslateTransform X="0" Y="0" />
            </StatusBar.RenderTransform>

            <StatusBarItem>
                <TextBlock Text="{Binding RcpSettings.StatusMessageLeft}"></TextBlock>
            </StatusBarItem>

            <StatusBarItem HorizontalAlignment="Right">
                <TextBlock Text="{Binding RcpSettings.StatusMessageRight}"></TextBlock>
            </StatusBarItem>
        </StatusBar>

        <!--LEFT TOOL BAR-->
        <ItemsControl x:Name="m_LeftToolBarPanel" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.ToolbarRegion}" DockPanel.Dock="Left">
            <ItemsControl.RenderTransform>
                <TranslateTransform X="0" Y="0" />
            </ItemsControl.RenderTransform>
        </ItemsControl>

        <!--MAIN LAYOUT-->
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MinHeight="{x:Static Windows1:Shell.VisualizationMenuMinHeight}" />
                <RowDefinition x:Name="m_SplitterRow" Height="{x:Static Windows1:Shell.SplitterSize}" />
                <RowDefinition x:Name="m_BottomTabMenuRow"
                               Height="{x:Static Windows1:Shell.BottomMenuDefaultHeight}"
                               MinHeight="{x:Static Windows1:Shell.BottomMenuMinHeight}"/>
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition MinWidth="{x:Static Windows1:Shell.VisualizationMenuMinWidth}" />
                <ColumnDefinition x:Name="m_SplitterColumn" Width="{x:Static Windows1:Shell.SplitterSize}" />
                <ColumnDefinition x:Name="m_RightTabMenuColumn"
                                  Width="{x:Static Windows1:Shell.RightMenuDefaultWidth}"
                                  MinWidth="{x:Static Windows1:Shell.RightMenuMinWidth}"/>
            </Grid.ColumnDefinitions>

            <!--ROW 1-->
            <!--Visualization Tab-->
            <Controls1:TabMenu x:Name="m_VisualizationTabControl" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.DocumentRegion}" 
                              Margin="3,0,0,0" Grid.Row="0" Grid.Column="0" Opacity="0.0">
            </Controls1:TabMenu>

            <GridSplitter x:Name="m_GridSplitter" Focusable="False" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" Height="Auto" Width="Auto" Opacity="0.0" HorizontalAlignment="Stretch" />

            <!--Right Tab-->
            <Controls1:TabMenu x:Name="m_RightPanelTabControl" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.SidePanelRegion}" VisibilityChanged="OnRightTabMenuVisibilityChanged" Margin="0" Padding="0" Background="{DynamicResource ExpanderTabControlBackground}" Grid.Row="0" Grid.Column="2" Grid.RowSpan="3" >
                <Controls1:TabMenu.RenderTransform>
                    <TranslateTransform X="0" Y="0" />
                </Controls1:TabMenu.RenderTransform>
            </Controls1:TabMenu>
            
            <!--ROW 2-->
            <GridSplitter x:Name="m_VerticalGridSplitter" Focusable="False" Grid.Row="1" Grid.Column="0" Height="Auto" Width="Auto" Opacity="0.0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
            
            <!--ROW 3-->
            <Controls1:TabMenu x:Name="m_BottomPanelTabControl" cal:RegionManager.RegionName="{x:Static Globals1:RegionNames.BottomRegion}" Grid.Row="2" Grid.Column="0" Margin="3,0,0,0" VisibilityChanged="OnBottomTabMenuVisibilityChanged">
            </Controls1:TabMenu>
        </Grid>

    </DockPanel>
</Controls1:ChromeWindow>
